/**
 * 书籍的数据库结构
 */
const mongoose = require('mongoose');
module.exports = () => {
    let schema = new mongoose.Schema({
        openId: String,//openid
        unionId: String,//unionid
        nickName: String, // 昵称
        sessionKey:String,//sessionkey
        gender: {
            type: Number,
            enum: [0, 1, 2],//0未知
            default: 0,
        },//活动图标
        province: String, // 省
        city: String, // 市
        country: String, // 国家
        avatarUrl: String, //头像
        privilege: Array,
        phoneNumber: String,
        deletedAt: Date,
        createdAt: Date,
        updatedAt: Date,
    }, {collection: 'wechat_user'});

    return schema;
    //return mongoose.model('WechatUser', schema);
};


